package cc.autoapi.pucong.auto.flow.core.flow.execNode.entity.node;

import cc.autoapi.pucong.auto.flow.core.flow.execNode.selfenum.DataTypeEnum;
import cc.autoapi.pucong.auto.flow.core.flow.execNode.selfenum.ParamPositionEnum;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @author pucong
 * @description 参数信息
 * @create 2024-09-24
 */
@Data
@Accessors(chain = true)
public class ExecParamIn implements Serializable {

    private static final long serialVersionUID = 1L;

    private String uuid;

    private String paramCode;

    /**
     * 数据类型 0数字 1字符串 2布尔 3时间 4map 5数组
     */
    private DataTypeEnum dateType;

    /**
     * 值
     */
    private Object dateValue;

    /**
     * 参数值
     * nodeId_ParamCode
     */
    private String paramValue;

    /**
     * 是否必填
     */
    private Boolean needValue;


    /**
     * 参数类型 0静态值 1前置接口返回值 2全局参数
     */
    private Integer paramDataType;

    private ParamPositionEnum paramPosition;

    public ExecParamIn(TaskNodeParamIn taskNodeParamIn) {
        this.uuid = taskNodeParamIn.getUuid();
        this.paramCode = taskNodeParamIn.getParamCode();
        this.dateType = taskNodeParamIn.getDateType();
        this.paramValue = taskNodeParamIn.getParamValue();
        this.needValue = taskNodeParamIn.getNeedValue();
        this.paramPosition = taskNodeParamIn.getParamPosition();
        this.paramDataType = taskNodeParamIn.getParamDataType();
    }
}
